package cn.nfwx.tv.manager;

import android.content.Context;

import cn.nfwx.tv.callback.ResponseWithFailListener;
import cn.nfwx.tv.okhttp.CustomOkHttpClient;
import cn.nfwx.tv.okhttp.UrlHelper;
import okhttp3.Callback;

/**
 * Created by dell on 2018/4/17.
 */

public class AdvertiseManager {

    /**
     * 获取广告图
     */
    public static String requestAdvertiseList(Callback callBack) {
        String request_tag = "requestAdvertiseList";
        CustomOkHttpClient.cancleAll(request_tag);
        String url = UrlHelper.getAdvertiseUrl();
        CustomOkHttpClient.doGet(url, request_tag, callBack);
        return request_tag;
    }

    /**
     * 获取广告图
     *
     * @param context
     * @param responseWithFailListener
     * @return
     */
    public static String requestIjkAdvertiseList(Context context, ResponseWithFailListener responseWithFailListener) {
        String request_tag = "requestIjkAdvertiseList";
        CustomOkHttpClient.cancleAll(request_tag);
        String url = UrlHelper.getIjkAdvertiseUrl();
        CustomOkHttpClient.getObjectRequest(context, url, request_tag, responseWithFailListener);
        return request_tag;
    }

    /**
     * 主体推荐
     *
     * @param context
     * @param responseCallback
     * @return
     */
    public static String requestIjkMovement(Context context, ResponseWithFailListener<String> responseCallback) {
        String request_tag = "requestIjkMovement";
        CustomOkHttpClient.cancleAll(request_tag);
        String url = UrlHelper.getIjkMovementUrl();
        CustomOkHttpClient.getObjectRequest(context, url, request_tag, responseCallback);
        return request_tag;
    }
}
